<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <title>新增加班申请</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/font-awesome.min.css" rel="stylesheet">
    <!-- bootstrap-table 表格插件样式 -->
    <link href="/ajax/libs/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    <link href="/feitian/css/ry-ui.css" rel="stylesheet">


    <link href="/ajax/libs/datapicker/bootstrap-datetimepicker.min.css" rel="stylesheet">

    <link rel="stylesheet" href="/ajax/libs/layer/theme/default/layer.css?v=3.1.1" id="layuicss-layer"><link rel="stylesheet" href="/ajax/libs/layer/theme/moon/style.css" id="layuicss-thememoonstylecss"></head>
<body>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-overtime-update" novalidate="novalidate">
        <div class="form-group">
            <label class="col-sm-3 control-label">用户id：</label>
            <div class="col-sm-8">
                <input name="userId" class="form-control" type="text" required="" aria-required="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">加班开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="startTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required="" aria-required="true">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">加班结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="endTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required="" aria-required="true">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">加班审批状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b">
                    <option value="1">待审批</option>
                    <option value="2">已通过</option>
                    <option value="3">取消</option>
                </select>
            </div>

        </div>
        <div class="layui-layer-btn layui-layer-btn-">
            <a class="layui-layer-btn0" id="save">确定</a>
            <a class="layui-layer-btn1" id="back">关闭</a>
        </div>
    </form>
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<!--&lt;!&ndash; bootstrap-table 表格插件 &ndash;&gt;-->
<!--<script src="/ajax/libs/bootstrap-table/bootstrap-table.min.js"></script>-->
<!--<script src="/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>-->
<!--<script src="/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js"></script>-->
<!--<script src="/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>-->
<!--<script src="/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js"></script>-->
<!--&lt;!&ndash; jquery-validate 表单验证插件 &ndash;&gt;-->
<!--<script src="/ajax/libs/validate/jquery.validate.min.js"></script>-->
<!--<script src="/ajax/libs/validate/messages_zh.min.js"></script>-->
<!--<script src="/ajax/libs/validate/jquery.validate.extend.js"></script>-->
<!--&lt;!&ndash; jquery-validate 表单树插件 &ndash;&gt;-->
<!--<script src="/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>-->
<!--&lt;!&ndash; jquery-export 表格导出插件 &ndash;&gt;-->
<!--<script src="/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>-->
<!--<script src="/ajax/libs/bootstrap-table/extensions/export/tableExport.js"></script>-->
<script src="/ajax/libs//datapicker/bootstrap-datetimepicker.min.js"></script>
<script>
    $(function(){
        init();
        update();
    })
    var id=location.search;
    function init(){
        $.ajax({
            url:"/system/overtime/getovertimebyid"+id,
            dataType:"json",
            type:"POST",
            async:false,
            success:function(data){
                $("#form-overtime-update [name=userId]").val(data.userId);
                $("#form-overtime-update [name=startTime]").val(data.startTime);
                $("#form-overtime-update [name=endTime]").val(data.endTime);
                $("#form-overtime-update [name=status]").val(data.status);
            }
        })
    }
    function update(){
        $("#save").click(function(){
            $.ajax({
                url:"/system/overtime/doupdate"+id,
                type:"POST",
                data:$("#form-overtime-update").serialize(),
                success:function(data){
                    if (data>0){
                        alert("修改成功！")
                        location.href="/system/overtime"
                    }
                }
            })
        })
        $("#back").click(function (){
            location.href="/system/overtime"
        })
    }
</script>
<script type="text/javascript">


    $("input[name='startTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='endTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>